res = 'A、E、I、O、U、Y'.split('、')

s = input().upper()
# print(s)
start = ord('A')
end = ord('Z')
for x in s[::-1]:
    if start <= ord(x) <= end:
        if x in res:
            print('YES')
            break
        else:
            print('NO')
            break